home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / bixdos.arc / ANSI2 < prev    next >
Text File  |  1986-11-24  |  16KB  |  319 lines

  1. TITLE: ANSI commands of which ANSI.SYS is a subset:
  2.  
  3.  ANSI Standard (X3.64) Control Sequences for Video Terminals and Peripherals
  4.                        in alphabetic order by mnemonic
  5.  
  6.      (Inspired by the article "Toward Stardardized Video Terminals: ANSI
  7.       X3.64 Device Control" by Mark L. Siegel, April 1984 BYTE, page 365)
  8.  
  9.                (Ps and Pn are parameters expressed in ASCII.)
  10.                (Numeric parameters are given in decimal radix.)
  11.                (Abbreviations are explained in detail at end.)
  12.                (Spaces used in this table for clarity are not
  13.                 used in the actual codes.)
  14.  
  15.                                                            Default    Type
  16. Sequence     Sequence                                      Parameter   or
  17. Mnemonic     Name              Sequence                    Value      Mode
  18. ---------------------------------------------------------------------------
  19. APC  Applicatn Program Command Esc Fe                                 Delim
  20. CBT  Cursor Backward Tab       Esc [ Pn Z                   1         EdF
  21. CCH  Cancel Previous Character Esc T
  22. CHA  Cursor Horzntal Absolute  Esc [ Pn G                   1         EdF
  23. CHT  Cursor Horizontal Tab     Esc [ Pn I                   1         EdF
  24. CNL  Cursor Next Line          Esc [ Pn E                   1         EdF
  25. CPL  Cursor Preceding Line     Esc [ Pn F                   1         EdF
  26. CPR  Cursor Position Report    Esc [ Pn ; Pn R              1, 1
  27. CSI  Control Sequence Intro    Esc [                                  Intro
  28. CTC  Cursor Tab Control        Esc [ Ps W                   0         EdF
  29. CUB  Cursor Backward           Esc [ Pn D                   1         EdF
  30. CUD  Cursor Down               Esc [ Pn B                   1         EdF
  31. CUF  Cursor Forward            Esc [ Pn C                   1         EdF
  32. CUP  Cursor Position           Esc [ Pn ; Pn H              1, 1      EdF
  33. CUU  Cursor Up                 Esc [ Pn A                   1         EdF
  34. CVT  Cursor Vertical Tab       Esc [ Pn Y                             EdF
  35. DA   Device Attributes         Esc [ Pn c                   0
  36. DAQ  Define Area Qualification Esc [ Ps o                   0
  37. DCH  Delete Character          Esc [ Pn P                   1         EdF
  38. DCS  Device Control String     Esc P                                  Delim
  39. DL   Delete Line               Esc [ Pn M                   1         EdF
  40. DMI  Disable Manual Input      Esc \                                  Fs
  41. DSR  Device Status Report      Esc [ Ps n                   0
  42. EA   Erase in Area             Esc [ Ps O                   0         EdF
  43. ECH  Erase Character           Esc [ Pn X                   1         EdF
  44. ED   Erase in Display          Esc [ Ps J                   0         EdF
  45. EF   Erase in Field            Esc [ Ps N                   0         EdF
  46. EL   Erase in Line             Esc [ Ps K                   0         EdF
  47. EMI  Enable Manual Input       Esc b                                  Fs
  48. EPA  End of Protected Area     Esc W
  49. ESA  End of Selected Area      Esc G
  50. FNT  Font Selection            Esc [ Pn ; Pn Space D        0, 0      FE
  51. GSM  Graphic Size Modify       Esc [ Pn ; Pn Space B        100, 100  FE
  52. GSS  Graphic Size Selection    Esc [ Pn Space C             none      FE
  53. HPA  Horz Position Absolute    Esc [ Pn `                   1         FE
  54. HPR  Horz Position Relative    Esc [ Pn a                   1         FE
  55. HTJ  Horz Tab w/Justification  Esc I                                  FE
  56. HTS  Horizontal Tab Set        Esc H                                  FE
  57. HVP  Horz & Vertical Position  Esc [ Pn ; Pn f              1, 1      FE
  58. ICH  Insert Character          Esc [ Pn @                   1         EdF
  59. IL   Insert Line               Esc [ Pn L                   1         EdF
  60. IND  Index                     Esc D                                  FE
  61. INT  Interrupt                 Esc a                                  Fs
  62. JFY  Justify                   Esc [ Ps ; ... ; Ps Space F  0         FE
  63. MC   Media Copy                Esc [ Ps i                   0
  64. MW   Message Waiting           Esc U
  65. NEL  Next Line                 Esc E                                  FE
  66. NP   Next Page                 Esc [ Pn U                   1         EdF
  67. OSC  Operating System Command  Esc ]                                  Delim
  68. PLD  Partial Line Down         Esc K                                  FE
  69. PLU  Partial Line Up           Esc L                                  FE
  70. PM   Privacy Message           Esc ^                                  Delim
  71. PP   Preceding Page            Esc [ Pn V                   1         EdF
  72. PU1  Private Use 1             Esc Q
  73. PU2  Private Use 2             Esc R
  74. QUAD Typographic Quadding      Esc [ Ps Space H             0         FE
  75. REP  Repeat Char or Control    Esc [ Pn b                   1
  76. RI   Reverse Index             Esc M                                  FE
  77. RIS  Reset to Initial State    Esc c                                  Fs
  78. RM   Reset Mode                Esc [ Ps l                   none
  79. SD   Scroll Down               Esc [ Pn T                   1         EdF
  80. SEM  Select Edit Extent Mode   Esc [ Ps Q                   0
  81. SGR  Select Graphic Rendition  Esc [ Ps m                   0         FE
  82. SL   Scroll Left               Esc [ Pn Space @             1         EdF
  83. SM   Select Mode               Esc [ Ps h                   none
  84. SPA  Start of Protected Area   Esc V
  85. SPI  Spacing Increment         Esc [ Pn ; Pn Space G        none      FE
  86. SR   Scroll Right              Esc [ Pn Space A             1         EdF
  87. SS2  Single Shift 2 (G2 set)   Esc N                                  Intro
  88. SS3  Single Shift 3 (G3 set)   Esc O                                  Intro
  89. SSA  Start of Selected Area    Esc F
  90. ST   String Terminator         Esc \                                  Delim
  91. STS  Set Transmit State        Esc S
  92. SU   Scroll Up                 Esc [ Pn S                   1         EdF
  93. TBC  Tab Clear                 Esc [ Ps g                   0         FE
  94. TSS  Thin Space Specification  Esc [ Pn Space E             none      FE
  95. VPA  Vert Position Absolute    Esc [ Pn d                   1         FE
  96. VPR  Vert Position Relative    Esc [ Pn e                   1         FE
  97. VTS  Vertical Tabulation Set   Esc J                                  FE
  98.  
  99. ---------------------------------------------------------------------------
  100.  
  101. Abbreviations:
  102.  
  103. Intro  an Introducer of some kind of defined sequence; the normal 7-bit
  104.        X3.64 Control Sequence Introducer is the two characters "Escape ["
  105.  
  106. Delim  a Delimiter
  107.  
  108. x/y    identifies a character by position in the ASCII table (column/row)
  109.  
  110. EdF    editor function (see explanation)
  111.  
  112. FE     format effector (see explanation)
  113.  
  114. F      is a Final character in
  115.             an Escape sequence (F from 3/0 to 7/14 in the ASCII table)
  116.             a control sequence (F from 4/0 to 7/14)
  117.  
  118. Gs     is a graphic character appearing in strings (Gs ranges from
  119.        2/0 to 7/14) in the ASCII table
  120.  
  121. Ce     is a control represented as a single bit combination in the C1 set
  122.        of controls in an 8-bit character set
  123.  
  124. C0     the familiar set of 7-bit ASCII control characters
  125.  
  126. C1     roughly, the set of control characters available only in 8-bit systems.
  127.        This is too complicated to explain fully here, so read Jim Fleming's
  128.        article in the February 1983 BYTE, especially pages 214 through 224.
  129.  
  130. Fe     is a Final character of a 2-character Escape sequence that has an
  131.        equivalent representation in an 8-bit environment as a Ce-type
  132.        (Fe ranges from 4/0 to 5/15)
  133.  
  134. Fs     is a Final character of a 2-character Escape sequence that is
  135.        standardized internationally with identical representation in 7-bit
  136.        and 8-bit environments and is independent of the currently
  137.        designated C0 and C1 control sets (Fs ranges from 6/0 to 7/14)
  138.  
  139. I      is an Intermediate character from 2/0 to 2/15 (inclusive) in the
  140.        ASCII table
  141.  
  142. P      is a parameter character from 3/0 to 3/15 (inclusive) in the ASCII
  143.        table
  144.  
  145. Pn     is a numeric parameter in a control sequence, a string of zero or
  146.        more characters ranging from 3/0 to 3/9 in the ASCII table
  147.  
  148. Ps     is a variable number of selective parameters in a control sequence
  149.        with each selective parameter separated from the other by the code
  150.        3/11 (which usually represents a semicolon); Ps ranges from
  151.        3/0 to 3/9 and includes 3/11
  152.  
  153. v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
  154. v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
  155.  
  156. Format Effectors versus Editor Functions
  157.  
  158. A format effector specifies how the final output is to be created.
  159. An editor function allows you to modify the specification.
  160.  
  161. For instance, a format effector that moves the "active position" (the 
  162. cursor or equvalent) one space to the left would be useful when you want to
  163. create an overstrike, a compound character made of two standard characters
  164. overlaid. Control-H, the Backspace character, is actually supposed to be a
  165. format effector, so you can do this. But many systems use it in a
  166. nonstandard fashion, as an editor function, deleting the character to the
  167. left of the cursor and moving the cursor left. When Control-H is assumed to
  168. be an editor function, you cannot predict whether its use will create an
  169. overstrike unless you also know whether the output device is in an "insert
  170. mode" or an "overwrite mode". When Control-H is used as a format effector,
  171. its effect can always be predicted. The familiar characters carriage
  172. return, linefeed, formfeed, etc., are defined as format effectors.
  173.  
  174. v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
  175. ^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
  176.  
  177. ANSI X3.64 Mode-Changing Parameters for use with the
  178.            Select Mode (SM) and Reset Mode (RM) functions
  179.  
  180.     Parameter           Mode          Mode Function
  181.     Characters          Mnemonic
  182.  column/    graphic
  183.   row       repres.
  184. ----------------------------------------------------------------------------
  185. 3/0           0                       an error condition
  186. 3/1           1          GATM         guarded-area transfer mode
  187. 3/2           2          KAM          keyboard action mode
  188. 3/3           3          CRM          control representation mode
  189. 3/4           4          IRM          insertion/replacement mode
  190. 3/5           5          SRTM         status-reporting transfer mode
  191. 3/6           6          ERM          erasure mode
  192. 3/7           7          VEM          vertical editing mode
  193. 3/8           8                       reserved for future standardization
  194. 3/9           9                       reserved for future standardization
  195. 3/10          :                       reserved separator for parameters
  196. 3/11          ;                       Standard separator for parameters
  197. 3/12          <                       reserved for private (experimental) use
  198. 3/13          =                       reserved for private (experimental) use
  199. 3/14          >                       reserved for private (experimental) use
  200. 3/15          ?                       reserved for private (experimental) use
  201. 3/1  3/0      10         HEM          horizontal editing mode
  202. 3/1  3/1      11         PUM          positioning unit mode
  203. 3/1  3/2      12         SRM          send/receive mode
  204. 3/1  3/3      13         FEAM         format effector action mode
  205. 3/1  3/4      14         FETM         format effector transfer mode
  206. 3/1  3/5      15         MATM         multiple area transfer mode
  207. 3/1  3/6      16         TTM          transfer termination mode
  208. 3/1  3/7      17         SATM         selected area transfer mode
  209. 3/1  3/8      18         TSM          tabulation stop mode
  210. 3/1  3/9      19         EBM          editing boundary mode
  211. 3/1  3/10     1:                      reserved separator for parameters
  212. 3/1  3/11     1;                      Standard separator for parameters
  213. 3/1  3/12     1<                      error condition--unspecified recovery
  214. 3/1  3/13     1=                      error condition--unspecified recovery
  215. 3/1  3/14     1>                      error condition--unspecified recovery
  216. 3/1  3/15     1?                      error condition--unspecified recovery
  217. 3/2  3/0      20         LNM          linefeed/newline mode (not in ISO 6429)
  218. 3/2  3/1      21
  219.  .            .
  220.  .            .                       reserved for future standardization
  221.  .            .
  222. 3/9  3/9      99
  223.  
  224. 3/12 3/0      <0
  225.  .            .
  226.  .            .                       reserved for private (experimental) use
  227.  .            .
  228. 3/15 3/15     ??
  229.  
  230. v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
  231. ^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
  232.  
  233. NOTES ON THE DEC VT100 IMPLEMENTATION
  234.  
  235. In the case of the popular DEC VT100 video-terminal implementation,
  236. the only mode that may be altered is the linefeed/newline (LNM) mode.
  237. Other modes are considered permanently set, reset, or not applicable
  238. .More..
  239.  
  240. as follows:
  241.  
  242.      Set:   ERM
  243.      Reset: CRM, EBM, FEAM, FETM, IRM, KAM, PUM, SRTM, TSM
  244.      N/A:   GATM, HEM, MATM, SATM, TTM, VEM
  245.  
  246. Control sequences implemented in the VT100 are as follows:
  247.  
  248.      CPR, CUB, CUD, CUF, CUP, CUU, DA, DSR, ED, EL, HTS, HVP, IND,
  249.      LNM, NEL, RI, RIS, RM, SGR, SM, TBC
  250.  
  251. plus several private DEC commands.
  252.  
  253. Erasing parts of the display (EL and ED) in the VT100 is performed thus:
  254.  
  255.      Erase from cursor to end of line           Esc [ 0 K    or Esc [ K
  256.      Erase from beginning of line to cursor     Esc [ 1 K
  257.      Erase line containing cursor               Esc [ 2 K
  258.      Erase from cursor to end of screen         Esc [ 0 J    or Esc [ J
  259.      Erase from beginning of screen to cursor   Esc [ 1 J
  260.      Erase entire screen                        Esc [ 2 J
  261.  
  262. The VT100 responds to receiving the DA (Device Attributes) control
  263.  
  264.      Esc [ c    (or Esc [ 0 c)
  265.  
  266. by transmitting the sequence
  267.  
  268.      Esc [ ? l ; Ps c
  269.  
  270. where Ps is a character that describes installed options.
  271.  
  272. The VT100's cursor location can be read with the DSR (Device Status
  273. Report) control
  274.  
  275.      Esc [ 6 n
  276.  
  277. The VT100 reports by transmitting the CPR sequence
  278.  
  279.      Esc [ Pl ; Pc R
  280.  
  281. where Pl is the line number and Pc is the column number (in decimal).
  282.  
  283. v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
  284. ^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
  285.  
  286. The complete document describing the standard,  "ANSI X3.64-1979:
  287. Additional Controls for Use with the American National Standard
  288. Code for Information Interchange," can be ordered for $13.50 (plus
  289. $4 postage) from
  290.  
  291.      Standards Sales Department
  292.      American National Standards Institute
  293.      1430 Broadway
  294.      New York, NY 10018
  295.      212/354-3300
  296.  
  297. It's best to read the full standard before using it. It also helps
  298. to have copies of the related standards "X3.4-1977: American
  299. National Standard Code for Information Interchange" (the ASCII
  300. standard) and "X3.41.1974: Code-Extension Techniques for Use with
  301. the 7-Bit Coded Character Set of American National Standard for
  302. Information Interchange."
  303.  
  304. See also the chapter "Using Extended Screens and Keyboard Control"
  305. in the IBM PC-DOS manuals (versions 2.0, 2.1, and 3.0), especially
  306. for the coding for character attributes.
  307.  
  308. The specification for the DEC VT100 is document EK-VT100-UG-003,
  309. available for $13.00 prepaid from:
  310.  
  311.      Digital Equipment Corporation
  312.      Accessories and Supplies Group
  313.      POB CS-2008
  314.      Nashua, NH 03061
  315.  
  316. (Copyright 1984 BYTE Publications, subsidiary of McGraw-Hill Inc.)
  317. (Permission granted to reproduce for noncommercial uses.)
  318. (This file prepared by Richard S. Shuford.)
  319.